import { Component, OnInit } from '@angular/core';
import { HttpClient, HttpHeaders, HttpClientJsonpModule } from '@angular/common/http';

@Component({
  selector: 'app-denglu',
  templateUrl: './denglu.component.html',
  styleUrls: ['./denglu.component.css']
})
export class DengluComponent implements OnInit {

  private peopleInfo: any = {
    username: '',
    mima: ''
  }

  private list:any[]=[];

  constructor(public Http: HttpClient) { }

  ngOnInit() {
  }
  search() {
    console.log(this.peopleInfo);
    const httpOptions = {
      headers: new HttpHeaders({
        'Content-Type': 'application/json;charset=UTF-8',
        'Access-Control-Allow-Origin': '*',
      })
    };
    var api = "http://10.100.185.117:4200/login";
    this.Http.post(api,this.peopleInfo, httpOptions).subscribe((response: any) => {

      console.log(response);
      alert(response.login1[0].login);
      

    })
  
  }
    

}
